import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import Index from '@/views/Index.vue'
import Register from '@/views/Register.vue'
import Default from '@/views/Default.vue'
import appointmentcancel from '@/views/appointmentcancel.vue'
import appointmentsuccess from '@/views/appointmentsuccess.vue'
import appointmentlist from '@/views/appointmentlist.vue'
import Appointment from '@/views/Appointment.vue'
import Hospital from '@/views/Hospital.vue'
import Setmeal from '@/views/Setmeal.vue'
import Selectdate from '@/views/Selectdate.vue'
import Confirmorder from '@/views/Confirmorder.vue'
import Appointsuccess from '@/views/Appointsuccess.vue'
import Appointlist from '@/views/Appointlist.vue'
import Appointcancel from '@/views/Appointcancel.vue'
import Personal from '@/views/Personal.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/index',
      component: Index,
      redirect: '/default',
      children: [
        {
          path: '/default',
          component: Default
        },
        {
          path: '/appointment',
          component: Appointment
        },
        {
          path: '/hospital',
          component: Hospital
        },
        {
          path: '/setmeal',
          component: Setmeal
        },
        {
          path: '/selectdate',
          component: Selectdate
        },
        {
          path: '/confirmorder',
          component: Confirmorder
        },
        {
          path: '/appointsuccess',
          component: Appointsuccess
        },
        {
          path: '/appointlist',
          component: Appointlist
        },
        {
          path: '/appointcancel',
          component: Appointcancel
        },
        {
          path: '/personal',
          component: Personal
        },
        {
          path: '/report',
          component: () => import('@/views/Report.vue')
        },
        {
                  path: '/reportlist',
                  component: () => import('@/views/Reportlist.vue')
                }
      ]
    },
    {
      path: '/appointmentsuccess',
      component: appointmentsuccess
    },
    {
      path: '/appointmentlist',
      component: appointmentlist
    },
    {
      path: '/appointmentcancel',
      component: appointmentcancel
    },
    {
      path: '/register',
      component: Register
    }
  ]
})

export default router
